package com.project.bean;

import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
import java.util.List;

/**
 * 项目实体类
 */
public class ProjectBean {
    /**项目编号*/
    private  int id;
    /**项目名称*/
    private String name;
    /**客户名称*/
    private String clientName;
    /**项目资金*/
    private int projectMoney;
    /**交互日期*/
    private LocalDate turnDate;
    /**还剩天数*/
    private String remainderDay;
    /**状态*/
    private String statues="开发中";
    /**项目参与人数*/
    private int peopleNumber;
    /**启动时间*/
    private LocalDate startDate = LocalDate.now();
    /**项目参与员工的集合*/
    private List<PProgressBean> employeeBeans;

    public ProjectBean() {
    }

    public ProjectBean(String name, String clientName, int projectMoney, LocalDate turnDate) {
        this.name = name;
        this.clientName = clientName;
        this.projectMoney = projectMoney;
        this.turnDate = turnDate;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getClientName() {
        return clientName;
    }

    public void setClientName(String clientName) {
        this.clientName = clientName;
    }

    public int getProjectMoney() {
        return projectMoney;
    }

    public void setProjectMoney(int projectMoney) {
        this.projectMoney = projectMoney;
    }

    public LocalDate getTurnDate() {
        return turnDate;
    }

    public void setTurnDate(LocalDate turnDate) {
        this.turnDate = turnDate;
    }

    public String getRemainderDay() {
        if (this.statues.equals("交付使用"))
        {
            return "已交付";
        }
        this.remainderDay = ChronoUnit.DAYS.between(startDate, turnDate)+"";
        return this.remainderDay;
    }



    public String getStatues() {
        return statues;
    }

    public void setStatues(String statues) {
        this.statues = statues;
    }

    public int getPeopleNumber() {
        return peopleNumber;
    }

    public void setPeopleNumber(int peopleNumber) {
        this.peopleNumber = peopleNumber;
    }

    public LocalDate getStartDate() {
        return startDate;
    }

    public void setStartDate(LocalDate startDate) {
        this.startDate = startDate;
    }

    public List<PProgressBean> getEmployeeBeans() {
        return employeeBeans;
    }

    public void setEmployeeBeans(List<PProgressBean> employeeBeans) {
        this.employeeBeans = employeeBeans;
    }

    @Override
    public String toString() {
        return "ProjectBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", clientName='" + clientName + '\'' +
                ", projectMoney=" + projectMoney +
                ", turnDate=" + turnDate +
                ", remainderDay='" + remainderDay + '\'' +
                ", statues='" + statues + '\'' +
                ", peopleNumber=" + peopleNumber +
                ", startDate=" + startDate +
                ", employeeBeans=" + employeeBeans +
                "}\n";
    }
}
